<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
header("Content-type: text/html; charset=utf-8");
define('SCRIPT','ad_list');
if(!$_COOKIE['userid']){
    echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
    exit;
}


?> 
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>闲置发布-众晒网</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css"/>             
    <script src="/ui/js/jquery-1.9.1.min.js"></script>
    <script src="/ui/plugins/swiper/swiper.min.js"></script>
    <script type="text/javascript" src="/ui/layer/mobile/layer.js"></script> 
    <style type="text/css">
     tr{border-bottom:1px solid #EDEDED}
.layui-tab{-5px 0px 45px 0px;text-align:left!important}
::-webkit-scrollbar { display: none;}   /*隐藏右边滚动条*/
        #header{width:100%; position:absolute; top:0;}                /*顶部定位*/
        #main{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}
    </style>  
    <style>
    #feedback{width:60px;margin:0 auto;}
    #feedback img{width:60px;height:60px;padding: 5px;box-shadow: 0 0 5px #ccc;border-radius: 5px;}
    .H-width-avg-4 {
    width: 100%;
    }
    select#sheng {
    border: 0px;
    margin-right: 196px;
    width: 55%;
    }
    select#shi {
    border: 0px;
    }
    select#qu {
    border: 0px;
    }
    .H-flex-item.H-padding-horizontal-both-10.H-font-size-16.H-padding-vertical-both-12 {
    height: 45px;
    }
    span {
    margin-top: -5px;
    }
    button.H-button.H-width-100-percent.H-font-size-18.H-outline-none.H-padding-vertical-both-8.H-padding-horizontal-both-17.H-theme-background-color8.H-theme-font-color-white.H-theme-border-color8.H-theme-border-color8-click.H-theme-background-color8-click.H-theme-font-color8-click.H-border-radius-3 {
    margin-top: 15px;
    }
    .H-margin-horizontal-both-10 {
    margin-left: 0px;
    width: 100%;
    margin-right: 10px;
    }
    .H-theme-background-color8 {
    background-color: #f26c27;
}
input#thegujia {
    margin-top: -6px;
}
select#shi {
    border: 0px;
    width: 122%;
}
select#sheng {
    border: 0px;
    margin-right: 196px;
    width: 55%;
}
.box{height: 45px;width: 300px;}
.box .comment{font-size: 30px;color: orange;}
.comment li{ float: left;cursor: pointer;}
ul{list-style: none;}
.H-horizontal-center.H-overflow-hidden {
    background: #ffffff;
    margin-top: 10px;
}
</style>      
</head>
<body ">
    <header class="H-header H-theme-background-color-white" id="header">
        <span tapmode="" onclick="window.location.href='receipt.php'" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color8 H-padding-horizontal-left-10 H-z-index-100"><label class="H-display-block H-vertical-middle H-font-size-15"><img src="/ui/image/发布取消叉@3x.png" style="width: 15px; height: 15px; margin-top: 15px; margin-left: 10px;"></label></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent">退款</div>
    </header>
    <div id="main"> 
    <div class="H-flexbox-horizontal H-theme-background-color-white H-border-vertical-bottom-after" onclick="H.openWin('#', '#');">
                <img src="ui/image/tuikuan.png" style="margin:40px auto; width: 60%; height: 20%;">
    </div>
    <div class="H-flexbox-horizontal" style="background: #ffffff;">
        <label style="padding-left: 10px;">支付宝账号：<input type="text" id="zfb" name="zfb" style="padding-left: 10px; border:0; border-bottom:1px solid #e6e6e6"></label>
    </div>
   
    <div class="H-flexbox-horizontal">
        <textarea name="ziwop" id="ziwop" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-12 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="请手动输入退款原因..."></textarea>
    </div> 
       <div class="H-horizontal-center  H-overflow-hidden" style="min-height: 100px;">
            <div style="margin-left:10px;width:50px;height:83px" onclick="getElementById('inputfile').click()">
            <div style="float:left; height: 83px;">
            <img src="/ui/image/相机 -4.png"  style="margin-top:15px;width:50px;height:48px" alt="" title="添加照片">
            <input type="file" accept="image/*" multiple="multiple" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: -100px;"/>
            <span style="font-size:12px">上传凭证(请上传最多三张图片)</span>
            </div>
            </div>
        </div>
        
    <div class="H-padding-vertical-bottom-10"></div>
    <div class="H-clear-both H-width-1-percent H-display-table H-box-sizing-border-box H-padding-horizontal-left-5">
        <div class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-4 H-padding-horizontal-right-5 H-margin-vertical-bottom-5">
           
            <div  style="width:100%"  id="feedback"  value="feedback" name="ywyuedu" >
            
            <input style=" display:none" id="srcall" name="ywyuedu">
             <input type="hidden" id="lat" name="lat">
             <input type="hidden" id="lng" name="lng">
        </div>

    </div>
    <div class="H-padding-vertical-bottom-10"></div>

 </div>
 <button type="button" onclick="clicimg()" class="am-btn am-btn-warning am-padding-sm" style="width: 88%; margin-left:6%;  margin-top: 75px; color: #ffffff; background: #ffa200;  bottom: 0px; font-weight: 800; border: 0;border-radius: 5px;height: 35px;">确认退款</button>
<script type="text/javascript">
$(document).ready(function(){
    //响应文件添加成功事件
    $("#inputfile").change(function(){
        //创建FormData对象
        var data = new FormData();
        //为FormData对象添加数据
        $.each($('#inputfile')[0].files, function(i, file) {
            data.append('upload_file'+i, file);
        });
         layer.open({
    type: 2
    ,content: '上传中...'
  }); //显示加载图片
        //发送数据
        $.ajax({
            url:'submit_form_process.php',
            type:'POST',
            data:data,
            cache: false,
            contentType: false,     //不可缺参数
            processData: false,     //不可缺参数
            success:function(data){
                data = $(data).html();
                //alert(data);
                //第一个feedback数据直接append，其他的用before第1个（ .eq(0).before() ）放至最前面。
                //data.replace(/&lt;/g,'<').replace(/&gt;/g,'>') 转换html标签，否则图片无法显示。
                if($("#feedback").children('img').length == 0) $("#feedback").append(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
                else $("#feedback").children('img').eq(0).before(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
                layer.closeAll();
                layer.open({
    content: '上传成功！'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });   //加载成功移除加载图片
            },
            error:function(){
                alert('上传出错');
                $(".loading").hide();   //加载失败移除加载图片
            }
        });
    });
});






</script>
<script type="text/javascript">
  function clicimg(){
    var zfb = $("#zfb").val();
	if(zfb==""){
		
	layer.open({
    content: '请输入支付宝账号'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });	
	return false;	
	}
	
        var legth=document.getElementsByName('thissrc');
        var srca="";
        for(var i=0;i<legth.length;i++){
            srca+=legth[i].src;
            srca+=",";
        }
        document.getElementById('srcall').value=srca;
		
	var reason= document.getElementById("ziwop").value;	
	var uid='<?=$_COOKIE['userid']?>';
	var id='<?=$_GET['id']?>';
    var wechat_account="没有";	
	
    $.ajax({
        url: '/api/muyin/api.php?s=user.apply_refund.php',
        type: 'POST',
        dataType: 'json',
        data: {uid:uid,
		oid:id,
		reason:reason,
		refund_pic:srca,
		wechat_account:wechat_account,
		alipay_account:zfb
		},
      })
	
    .done(function(respon) {
    if (respon.code==0) {
		

	layer.open({
    content: '成功'
    ,btn: ['知道了']
    ,yes: function(index){
     
window.location.href = document.referrer;
      layer.close(index);
    }
  });
    
  }
  
    })

  }
</script>
</body>
</html>